﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@page import="com.webside.points.wechat.Wechat"%>
<%
	 //正常跳转
	String code = (String)request.getParameter("code");
  
	String openId = null;
	
	if(code != null){
		Wechat.getOpenId(code,request,response);
	}
	
	if(openId == null){
		openId = (String)request.getParameter("openId");
		
		openId = (String)request.getSession().getAttribute("openId");
		
		if(openId!=null){
			request.getSession().setAttribute("openId",openId);
		}
	}
	//如果从其他界面返回时，code已经失效，需要重新请求一次
	
	if(openId == null){
	   response.sendRedirect("../wechat/getWeChatCode");
	   return;
	}  
	
 %> 
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="../css/amazeui.min.css">
	<link rel="stylesheet" href="../css/style.css"/>
	<link rel="stylesheet" href="../css/weui.css" />
    <link rel="stylesheet" href="../css/wap.css">
    <title>专家协议</title>
</head>
  <script src="../js/jquery.js"></script>
  <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  <script src="../js/jssdk.js"></script>
<body style="background:#ececec">
<div class="pet_mian" >

<div class="pet_content">
<div class="pet_content_block">
  <article data-am-widget="paragraph" class="am-paragraph am-paragraph-default pet_content_article" data-am-paragraph="{ tableScrollable: true, pureview: true }">
  <p style="text-align:center;">${expertProtocol[0].title}</p>
      <p class=paragraph-default-p id="content">${expertProtocol[0].content}</p>
  </article>
  <div style="text-align:center;padding-bottom:20px">
    <a href="${ctx }/issueType/findAll?mark=expert&openId=<%=openId %>" style="font-size:17px;margin:20px;" class="weui-btn weui-btn_primary">同意</a>
  </div>

</div>
</div>
 <!--底部-->
    <div data-am-widget="navbar" class="am-navbar am-cf my-nav-footer " id="">
     <ul class="am-navbar-nav am-cf am-avg-sm-4 my-footer-ul">
		<li>
           <a href="${ctx }/user/findUserIssue?issueTypeId=0" class="">
            <span class="am-icon-home"></span>
            <span class="am-navbar-label">首页</span>
          </a>
        </li>
        <li>
          <a href="${ctx }/issueType/findAll?mark=service&openId=<%=openId %>" class="">
            <span class="am-icon-comments"></span>
            <span class="am-navbar-label">提问</span>
          </a>
        </li>
		<li>
          <a href="${ctx }/postType/findAllPostType" class="">
            <span class="am-icon-book"></span>
            <span class="am-navbar-label">学习</span>
          </a>
        </li>
        <li style="position:relative">
          <a href="${ctx }/user/findByOpenId?openId=<%=openId %>" class="">
            <span class="am-icon-user"></span>
            <span class="am-navbar-label">我的</span>
          </a>
        </li>
      </ul>
</div>
</div>
<script src="../js/jquery.min.js"></script>
 <script src="../js/amazeui.min.js"></script>
    <script src="../js/text-calculation.js"></script>
</body>
</html>